Python API Development Fundamentals by Jack Chan Ray Chung and Jack Huang
Author:Jack Chan, Ray Chung, and Jack Huang
Language: eng
Format: mobi
Publisher: Packt Publishing Pvt Ltd
Published: 2019-11-20T16:00:00+00:00
Using the webargs Package to Parse the Request Arguments
The request arguments, also known as the query string, are the arguments that we can pass in through the URL. For example, in the URL http://localhost/testing?abc=123, abc=123 is the request argument.
webargs is a package for parsing request arguments. We will create a new endpoint, GET http://localhost:5000/user/{username}/recipes, to get all the published recipes from a particular author. For this endpoint, we will pass in the visibility request argument. The visibility request argument can have a value of public, private, or all. The default value is public. If it is private or all, the user needs to be authenticated first.
If you want to get only the unpublished recipes, you can add the request argument visibility=private. So, the URL will look like this: http://localhost:5000/user/{username}/recipes?visibility=private. The webargs package provides functions to parse this visibility=private argument in the URL, and then our Smilecook application will know this request is asking for private information in the recipe. Our Smilecook application will then determine whether the authenticated user is the author. If they are, it will return all the unpublished recipes. Otherwise, there is no permission for the user to see the unpublished recipes.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Content Management | Programming |
User Experience & Usability | User Generated Content |
Web Design | Web Marketing |
Web Services | Website Analytics |
Hello! Python by Anthony Briggs(9423)
The Mikado Method by Ola Ellnestam Daniel Brolund(9352)
Dependency Injection in .NET by Mark Seemann(8896)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(7440)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7161)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(6275)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6006)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5535)
Kotlin in Action by Dmitry Jemerov(4683)
Audition by Ryu Murakami(4140)
Hands-On Full-Stack Web Development with GraphQL and React by Sebastian Grebe(3991)
Functional Programming in JavaScript by Mantyla Dan(3742)
Svelte with Test-Driven Development by Daniel Irvine(3381)
Layered Design for Ruby on Rails Applications by Dementyev Vladimir;(3009)
Test-Driven Development with PHP 8 by Rainier Sarabia(2980)
Learning React: Functional Web Development with React and Redux by Banks Alex & Porcello Eve(2865)
WordPress Plugin Development Cookbook by Yannick Lefebvre(2688)
Architecting Modern Java EE Applications: Designing lightweight, business-oriented enterprise applications in the age of cloud, containers, and Java EE 8 by Daschner Sebastian(2570)
Web Development with Django by Ben Shaw Saurabh Badhwar(2438)